/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.openbrew.openbrewrf;

import com.openbrew.openbrewrf.views.FGIView;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author chapmand
 */
@Entity
@Table(name = "ACB")
@XmlRootElement
public class ACB implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "acbID")
    private Integer acbid;
    @Basic(optional = false)
    @NotNull
    @Column(name = "acbQty")
    private int acbqty;
    @Basic(optional = false)
    @NotNull
    @Column(name = "acbFilled")
    private boolean acbfilled;
    @JoinColumn(name = "acbFGI", referencedColumnName = "FGIID")
    @ManyToOne(optional = false)
    private FGIView acbfgi;
    @Basic(optional = false)
    @NotNull
    @Column(name = "servingTankVolume")
    private float servingTankVolume;

    public ACB() {
    }

    public ACB(Integer acbid) {
        this.acbid = acbid;
    }

    public ACB(Integer acbid, int acbqty, boolean acbfilled) {
        this.acbid = acbid;
        this.acbqty = acbqty;
        this.acbfilled = acbfilled;
    }

    public Integer getACBID() {
        return acbid;
    }

    public void setACBID(Integer acbid) {
        this.acbid = acbid;
    }
    
    public int getACBQty(){
        return acbqty;
    }
    
    public void setACBQty(int acbqty){
        this.acbqty = acbqty;
    }
    
    public boolean getACBFilled(){
        return acbfilled;
    }
    
    public void setACBFilled(boolean acbfilled){
        this.acbfilled = acbfilled;
    }
    
    public FGIView getACBFGI(){
        return acbfgi;
    }
    
    public void setACBFGI(FGIView acbfgi){
        this.acbfgi = acbfgi;
    }

    public float getServingTankVolume() {
        return servingTankVolume;
    }

    public void setServingTankVolume(float servingTankVolume) {
        this.servingTankVolume = servingTankVolume;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (acbid != null ? acbid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Sales)) {
            return false;
        }
        ACB other = (ACB) object;
        if ((this.acbid == null && other.acbid != null) || (this.acbid != null && !this.acbid.equals(other.acbid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.openbrew.openbrewrf.ACB[ acbid=" + acbid + " ]";
    }
    
}
